home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 051-075 / scopedisk70 / menumgr / menumanager.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-19  |  21KB  |  644 lines

  1. /*-----------------------------Start Rexx Source------------------------------*/
  2. /*
  3.           MenuManager.rexx
  4.  
  5.                 by
  6.  
  7.            Dan R. Schenck
  8.            7010 E. 77th Place
  9.            Tulsa, OK
  10.  
  11.            (918) 492-0523
  12.  
  13.            GEnie: D.SCHENCK
  14.  
  15.                                */
  16.  
  17. /* Requires rexarplib.library v2.1 */
  18.  
  19.  
  20. true = 1
  21. false = 0
  22. WinOpen = false
  23.  
  24. cdir = Pragma("D")
  25. if right(cdir,1) ~= ":" & right(cdir,1) ~= "/" then cdir = cdir || "/"
  26.  
  27. if arg() > 0 then
  28.   do
  29.     parse upper arg opt .
  30.     if opt = "-F" then
  31.       do until(DefFile ~= "||||")
  32.         DefFile = GetFile(50,50,cdir,"MenuManager.def","Select MenuManager Definition File")
  33.         if DefFile = "" then exit
  34.         if ~exists(DefFile) then
  35.           do
  36.             call PostError(1,"W")
  37.             DefFile = "||||"
  38.           end
  39.       end
  40.     else call PostError(4,"A")
  41.    end
  42. else
  43.   do
  44.     if exists(cdir||"MenuManager.def") then DefFile = cdir||"MenuManager.def"
  45.     else
  46.       do
  47.         if exists("s:MenuManager.def") then DefFile = "s:MenuManager.def"
  48.         else
  49.           do
  50.             call PostError(1,"A")
  51.             exit
  52.           end
  53.       end
  54.   end
  55. RamFile = "T:$$mmin.tmp"
  56. address command "copy" DefFile "to" RamFile
  57.  
  58. time2quit = false
  59. sysinfo = "    MenuManager v1.00\"
  60. sysinfo = sysinfo || "       Written by:\       Dan Schenck\\"
  61. sysinfo = sysinfo || "     Tulsa, Oklahoma"
  62. xfile = 'T:$$rx.tmp'
  63. Scmd = "SUBITEM"
  64. Icmd = "ITEM"
  65. Mcmd = "MENU"
  66. action = "."
  67. name = "&"
  68. cmd = "="
  69. help = "$"
  70. IHelp = false
  71. LAct = false
  72. xfilecnt = 0
  73.  
  74. call PostMsg(50,50,"PATIENCE!\Processing Menu Definition File\\")
  75. rtn = ParseMenu(RamFile)
  76. if rtn > 0 then call PostError(rtn,"A")
  77.  
  78. call MenuWindow1(MMHOST,MMPORT)
  79. call MenuSetUp
  80. call PostMsg()
  81.  
  82.   do until(time2quit) /*1*/
  83.     t = waitpkt(MMPORT)
  84.     ii = false
  85.     do until(ii) /*2*/
  86.       p = getpkt(MMPORT)
  87.       if c2d(p) = 0 then break
  88.       command = getarg(p)
  89.       t = reply(p,0)
  90.       ii = true
  91.       select
  92.  
  93.         when command = "SYSINFO" & ~IHelp & ~LAct then call Request(100,100,sysinfo,,"  OK  ")
  94.  
  95.         when command = "ITEMHELP" then
  96.           do
  97.             if ~LAct then
  98.               do
  99.                 call PostMsg(50,50,"Select Menu Item You Want Help On")
  100.                 IHelp = true
  101.               end
  102.           end
  103.  
  104.         when command = "QUITMM" | command = "CLOSEWINDOW" then call EndAll
  105.  
  106.         when command = "CHNGMENU" then
  107.           do
  108.             if ~IHelp & ~LAct then
  109.             do
  110.               DefFile = GetFile(50,50,cdir,"MenuManager.def","Select New Definition File")
  111.               if DefFile ~= "" then
  112.                 do
  113.                   call PostMsg(50,50,"PATIENCE!\Processing Menu Definition File\\")
  114.                   call RemoveMenu(MMHOST)
  115.                   address command "copy" DefFile "to" RamFile            
  116.                   rtn = ParseMenu(RamFile)
  117.                   if rtn > 0 then call PostError(rtn,"A")
  118.                   call MenuSetUp
  119.                   call PostMsg()
  120.                 end
  121.             end
  122.           end
  123.         when command = "LISTACTN" then
  124.           do
  125.             if ~IHelp then
  126.               do
  127.                 call PostMsg(50,50,"Select Menu Item To List Actions Of")
  128.                 LAct = true
  129.               end
  130.           end
  131.         otherwise
  132.           do jj = 1 to 1
  133.             parse var command mtxt "." n "." j "." k
  134.             if k ~= "" then
  135.               do
  136.                 if IHelp then
  137.                   do
  138.                     IHelp = false
  139.                     if shelps.n.j.k = 0 then
  140.                       do
  141.                         call PostMsg(50,50,"No Help Available on This Item")
  142.                         call Delay(150)
  143.                         call PostMsg()
  144.                         leave jj
  145.                       end
  146.                     call PostMsg()
  147.                     hmsg = ""
  148.                     do h = 1 to shelps.n.j.k
  149.                       hmsg = hmsg || shelp.n.j.k.h || "\"
  150.                     end
  151.                     call Request(25,25,hmsg,,,"  DONE  ")
  152.                     leave jj
  153.                   end
  154.                 if sactions.n.j.k = 1 then
  155.                   do
  156.                     if LAct then
  157.                       do
  158.                         LAct = false
  159.                         call PostMsg()
  160.                         call Request(25,25,saction.n.j.k.1,,,"  DONE  ")
  161.                         leave jj
  162.                       end
  163.                     CurAct = ParseAction(saction.n.j.k.1)
  164.                     address command CurAct
  165.                     leave jj
  166.                   end
  167.                 else
  168.                   do
  169.                     if LAct then
  170.                       do
  171.                         LAct = false
  172.                         actmsg = ""
  173.                         do a = 1 to sactions.n.j.k
  174.                           actmsg = actmsg || saction.n.j.k.a || "\"
  175.                         end
  176.                         call PostMsg()
  177.                         call Request(25,25,actmsg,,,"  DONE  ")
  178.                         leave jj
  179.                       end
  180.                     xfilecnt = xfilecnt + 1
  181.                     call open('out',xfile||xfilecnt,"W")
  182.                     do a = 1 to sactions.n.j.k
  183.                       CurAct = ParseAction(saction.n.j.k.a)
  184.                       call writeln('out',CurAct)
  185.                     end
  186.                     call close('out')
  187.                     address command "run" "execute" xfile || xfilecnt
  188.                   end
  189.                 leave jj
  190.               end
  191.             else
  192.               do
  193.                 if IHelp then
  194.                   do
  195.                     IHelp = false
  196.                     if helps.n.j = 0 then
  197.                       do
  198.                         call PostMsg(50,50,"No Help Available on This Item")
  199.                         call Delay(150)
  200.                         call PostMsg()
  201.                         leave jj
  202.                       end
  203.                     call PostMsg()
  204.                     hmsg = ""
  205.                     do h = 1 to helps.n.j
  206.                       hmsg = hmsg || help.n.j.h || "\"
  207.                     end
  208.                     call Request(25,25,hmsg,,,"  DONE  ")
  209.                     leave jj
  210.                   end
  211.                 if actions.n.j = 1 then
  212.                   do
  213.                     if LAct then
  214.                       do
  215.                         LAct = false
  216.                         call PostMsg()
  217.                         call Request(25,25,action.n.j.1,,,"  DONE  ")
  218.                         leave jj
  219.                       end
  220.                     CurAct = ParseAction(action.n.j.1)
  221.                     address command CurAct
  222.                     leave jj
  223.                   end
  224.                 else
  225.                   do
  226.                     if LAct then
  227.                       do
  228.                         LAct = false
  229.                         actmsg = ""
  230.                         do a = 1 to actions.n.j
  231.                           actmsg = actmsg || action.n.j.a || "\"
  232.                         end
  233.                         call PostMsg()
  234.                         call Request(25,25,actmsg,,,"  DONE  ")
  235.                         leave jj
  236.                       end
  237.                     xfilecnt = xfilecnt + 1
  238.                     call open('out',xfile||xfilecnt,"W")
  239.                     do a = 1 to actions.n.j
  240.                       CurAct = ParseAction(action.n.j.a)
  241.                       call writeln('out',CurAct)
  242.                     end
  243.                     call close('out')
  244.                     address command "run" "execute" xfile || xfilecnt
  245.                   end
  246.                 leave jj
  247.               end
  248.           end
  249.         end
  250.     end
  251.   end
  252.   exit
  253.  
  254.   ParseAction: procedure  expose PostError cdir WinOpen
  255.  
  256.   parse arg action
  257.  
  258.   l = lastpos("[",action)
  259.   do while l ~= 0
  260.     r = index(action,"]",l)
  261.     if r = 0 then call PostError(30,"A")  /* Missing "]" */
  262.     len = r - l -1
  263.     if len <= 0 then call PostError(30,"A")
  264.     str = substr(action,l+1,len)
  265.     do until(dbl = 0)
  266.       dbl = index(str,"!!")
  267.       if dbl > 0 then str = insert('FF'x,delstr(str,dbl,2),dbl-1)
  268.     end
  269.     msg = index(str,"!")
  270.     do until(dbl = 0)
  271.       dbl = index(str,"%%")
  272.       if dbl > 0 then str = insert('FE'x,delstr(str,dbl,2),dbl-1)
  273.     end
  274.     dir = index(str,"%")
  275.     if msg = 0 & dir = 0 then str = Request(50,50,"Enter Parameter","","   OK   "," CANCEL ")
  276.     else if msg > 0 then
  277.       do
  278.         if dir > 0 then
  279.           do
  280.             if msg > dir then
  281.               do
  282.                 msgtxt = translate(substr(str,msg+1),"!%",'FFFE'x)
  283.                 tmp = msg - dir -1
  284.                 if tmp < 0 then call PostError(32,"A")  /* Invalid Action Parameters */
  285.                 if tmp = 0 then dirtxt = cdir
  286.                 else dirtxt = translate(substr(str,dir+1,tmp),"!%",'FFFE'x)
  287.                 if msgtxt = "" then msgtxt = "Select a File"
  288.                 if dirtxt = "" then dirtxt = cdir
  289.                 str = GetFile(50,50,dirtxt,"",msgtxt)
  290.               end
  291.             else
  292.               do
  293.                 dirtxt = translate(substr(str,dir+1),"!%",'FFFE'x)
  294.                 tmp = dir - msg -1
  295.                 if tmp < 0 then call PostError(32,"A")
  296.                 if tmp = 0 then msgtxt = "Select a File"
  297.                 else msgtxt = translate(substr(str,msg+1,tmp),"!%",'FFFE'x)
  298.                 if dirtxt = "" then dirtxt = cdir
  299.                 str = GetFile(50,50,dirtxt,"",msgtxt)
  300.               end
  301.           end
  302.         else
  303.           do
  304.             msgtxt = translate(substr(str,msg+1),"!%",'FFFE'x)
  305.             if msgtxt = "" then msgtxt = "Enter Parameter"
  306.             str = Request(50,50,msgtxt,"","   OK   "," CANCEL ")
  307.           end
  308.       end
  309.       else
  310.         do
  311.           dirtxt = translate(substr(str,dir+1),"!%",'FFFE'x)
  312.           if dirtxt = "" then dirtxt = cdir
  313.           str = GetFile(50,50,dirtxt,"","Select a File")
  314.         end
  315.     if l = 1 then
  316.       do
  317.         if r = length(action) then action = str
  318.         else action = str || substr(action,r+1)
  319.       end
  320.     else
  321.       do
  322.         if r = length(action) then action = substr(action,1,l-1) || str
  323.         else action = substr(action,1,l-1) || str || substr(action,r+1)
  324.       end
  325.     l = lastpos("[",action)
  326.   end
  327.   return action
  328.  
  329.   EndAll:
  330.   call CloseWindow(MMHOST)
  331.   address command "delete" ">NIL:" xfile||"*" chfile RamFile
  332.   exit
  333.  
  334.   MenuWindow1:
  335.   arg hostcntl, hostport
  336.  
  337.   chfile = "T:$$MenuMgr.rexx"
  338.   if ~exists(chfile) then
  339.     do
  340.       call open('out',chfile,"Write")
  341.       call writeln('out',"/* Start Rexx Source */")
  342.       call writeln('out',"x = createhost(" || hostcntl || "," || hostport || ")")
  343.       call close('out')
  344.     end
  345.   address command arun "rx" chfile
  346.   mp = openport(hostport)
  347.   address command "c:WaitForPort" hostcntl
  348.   address command "c:WaitForPort" hostport
  349.   do until(showlist("P",hostcntl) & showlist("P",hostport))
  350.     call delay(10)
  351.   end
  352.   
  353.   idcmp = 'CLOSEWINDOW+GADGETUP+MENUPICK'
  354.   flags = 'WINDOWCLOSE+WINDOWDRAG+WINDOWDEPTH'
  355.  
  356.   call OpenWindow(hostcntl,0,0,588,10,idcmp,flags,"MenuManager v1.00 by Dan Schenck")
  357.   WinOpen = true
  358.   return 0
  359.  
  360.   MenuSetUp:
  361.  
  362.   call PostMsg(50,50,"\\\Setting Up Menus")
  363.   call AddMenu(MMHOST,"System ")
  364.   call AddItem(MMHOST,"About MenuManager","SYSINFO")
  365.   call AddItem(MMHOST,"Quit MenuManager ","QUITMM","Q")
  366.   call AddMenu(MMHOST,"Options ")
  367.   call AddItem(MMHOST,"Change Menu      ","CHNGMENU",,'FF FE'x)
  368.   call AddItem(MMHOST,"Item Help        ","ITEMHELP","H",'FF FD'x)
  369.   call AddItem(MMHOST,"List Item Actions","LISTACTN",,'FF FB'x)
  370.   do n = 1 to menu_no while menu_no > 0
  371.     call AddMenu(MMHOST,menu.n)
  372.     do j = 1 to items.n while items.n > 0
  373.       if sitems.n.j > 0 then
  374.         do
  375.           call AddItem(MMHOST,item.n.j,msg.n.j)
  376.           do k = 1 to sitems.n.j
  377.             if sitemHK.n.j.k = "" then call AddSubItem(MMHOST,sitem.n.j.k,msg.n.j.k)
  378.             else call AddSubItem(MMHOST,sitem.n.j.k,msg.n.j.k,sitemHK.n.j.k)
  379.           end
  380.         end                
  381.       else if itemHK.n.j = "" then call AddItem(MMHOST,item.n.j,msg.n.j)
  382.         else call AddItem(MMHOST,item.n.j,msg.n.j,itemHK.n.j)
  383.     end
  384.   end
  385.   call PostMsg(50,50,"\\\READY!")
  386.   call Delay(25)
  387.   return
  388.  
  389. PostError:
  390.  
  391. parse arg errno, severity
  392. call PostMsg() /* close any outstanding messages */
  393. select
  394.   when errno = 1 then
  395.     do
  396.       call PostMsg(50,50,"WARNING!\\Menu Definition File Not Found\\ABORTING!")
  397.       call Delay(150)
  398.       call PostMsg()
  399.     end
  400.   when errno = 4 then
  401.     do
  402.       call PostMsg(50,50,"WARNING!\\Illegal Argument to MenuManager\\ABORTING!")
  403.       call Delay(150)
  404.       call PostMsg()
  405.     end
  406.   when errno = 10 then
  407.     do
  408.       call PostMsg(50,50,"WARNING!\\Command Unknown or Out Of Sequence\Line Number:  "||CurMenuLine||"\\ABORTING!")
  409.       call Delay(150)
  410.       call PostMsg()
  411.     end
  412.   when errno = 12 then
  413.     do
  414.       call PostMsg(50,50,"WARNING!\\Action Field Out Of Sequence\Line Number:  "||CurMenuLine||"\\ABORTING!")
  415.       call Delay(150)
  416.       call PostMsg()
  417.     end
  418.   when errno = 14 then
  419.     do
  420.       call PostMsg(50,50,"WARNING!\\Name Field Out Of Sequence\Line Number:  "||CurMenuLine||"\\ABORTING!")
  421.       call Delay(150)
  422.       call PostMsg()
  423.     end
  424.   when errno = 16 then
  425.     do
  426.       call PostMsg(50,50,"WARNING!\\Command Field Out Of Sequence\Line Number:  "||CurMenuLine||"\\ABORTING!")
  427.       call Delay(150)
  428.       call PostMsg()
  429.     end
  430.   when errno = 18 then
  431.     do
  432.       call PostMsg(50,50,"WARNING!\\Help Field Out Of Sequence\Line Number:  "||CurMenuLine||"\\ABORTING!")
  433.       call Delay(150)
  434.       call PostMsg()
  435.     end
  436.   when errno = 20 then
  437.     do
  438.       call PostMsg(50,50,"WARNING!\\Duplicate Hot Key\Line Number:  "||CurMenuLine||"\\ABORTING!")
  439.       call Delay(150)
  440.       call PostMsg()
  441.     end
  442.   when errno = 22 then
  443.     do
  444.       call PostMsg(50,50,"WARNING!\\Hot Key Too Long - Invalid\Line Number:  "||CurMenuLine||"\\ABORTING!")
  445.       call Delay(150)
  446.       call PostMsg()
  447.     end
  448.   when errno = 30 then
  449.     do
  450.       call PostMsg(50,50,"WARNING!\\Missing or Incorrectly Ordered Brackets\in Action Field\\ABORTING!")
  451.       call Delay(150)
  452.       call PostMsg()
  453.     end
  454.   when errno = 32 then
  455.     do
  456.       call PostMsg(50,50,"WARNING!\\Invalid Parameter(s) in Action Field\\ABORTING!")
  457.       call Delay(150)
  458.       call PostMsg()
  459.     end
  460.   when errno = 99 then
  461.     do
  462.       call PostMsg(50,50,"WARNING!\\System Error\Line Number:  "||CurMenuLine||"\\ABORTING!")
  463.       call Delay(150)
  464.       call PostMsg()
  465.     end
  466.   otherwise return
  467. end
  468.  
  469. if upper(left(severity,1)) = "A" then
  470.   do
  471.     if WinOpen then call CloseWindow(MMHOST)
  472.     exit
  473.   end
  474.  
  475. return
  476.  
  477. /*
  478.   Parse the menu definition file and build menu arrays
  479. */
  480. ParseMenu:
  481.  
  482. parse arg MenuDefFile
  483. menu_no = 0    /* Number of menus */
  484. HKey = "HQ"    /* Hot keys string */
  485. CurMenuLine = 0
  486. next = cmd
  487. LastCmd = "null"
  488. call open('in',MenuDefFile,"R")
  489. do until(eof('in'))
  490.   instr = readln('in')
  491.   CurMenuLine = CurMenuLine + 1
  492.   call PostMsg(50,50,"\\\Processing line "||CurMenuLine)
  493.   instr = strip(instr,'L')
  494.   trigger = left(instr,1)
  495.   if trigger = next | (next = action & (trigger = cmd | trigger = help)) then
  496.     do
  497.       select
  498.         when trigger = cmd then
  499.           do
  500.             CmdName = upper(word(substr(instr,2),1))
  501.             select
  502.               when LastCmd = "null" then
  503.                 do
  504.                   if CmdName ~= Mcmd then return 10  /* Command unknown or out
  505.                                                         of sequence */
  506.                   else nop
  507.                   LastCmd = Mcmd
  508.                   next = name
  509.                 end
  510.               when LastCmd = Mcmd then
  511.                 do
  512.                   if CmdName ~= Icmd then return 10
  513.                   else nop
  514.                   LastCmd = Icmd
  515.                   next = name
  516.                 end
  517.               when LastCmd = Icmd | LastCmd = Scmd then
  518.                 do
  519.                   if CmdName ~= Icmd & CmdName ~= Scmd & CmdName ~= Mcmd then return 10
  520.                   else nop
  521.                   LastCmd = CmdName
  522.                   next = name
  523.                 end
  524.               otherwise call PostError(99,"A") /* System Error - ABORT */
  525.             end
  526.           end
  527.         when trigger = name then
  528.           do
  529.             select
  530.               when LastCmd = Mcmd then
  531.                 do
  532.                   MenuName = substr(instr,2)
  533.                   menu_no = menu_no + 1
  534.                   menu.menu_no = MenuName
  535.                   items.menu_no = 0
  536.                   next = cmd
  537.                 end
  538.               when LastCmd = Icmd then
  539.                 do
  540.                   instr = substr(instr,2)
  541.                   parse var instr ItemName "@" HotKey
  542.                   HotKey = strip(HotKey)
  543.                   if length(HotKey) = 1 then
  544.                     do
  545.                       HotKey = upper(HotKey)
  546.                       if index(HKey,HotKey) > 0 then return 20
  547.                       HKey = HKey || HotKey
  548.                     end
  549.                   else
  550.                     if length(HotKey) > 1 then return 22  /* Invalid hot key (too long) */
  551.                   items.menu_no = items.menu_no + 1
  552.                   tmp = items.menu_no
  553.                   item.menu_no.tmp = ItemName
  554.                   itemHK.menu_no.tmp = HotKey
  555.                   sitems.menu_no.tmp = 0
  556.                   actions.menu_no.tmp = 0
  557.                   helps.menu_no.tmp = 0
  558.                   next = action
  559.                 end
  560.               when LastCmd = Scmd then
  561.                 do
  562.                   instr = substr(instr,2)
  563.                   parse var instr SItemName "@" HotKey
  564.                   HotKey = strip(HotKey)
  565.                   if length(HotKey) = 1 then
  566.                     do
  567.                       HotKey = upper(HotKey)
  568.                       if index(HKey,HotKey) > 0 then return 20
  569.                       HKey = HKey || HotKey
  570.                     end
  571.                   else
  572.                     if length(HotKey) > 1 then return 22  /* Invalid hot key (too long) */
  573.                   tmp = items.menu_no
  574.                   sitems.menu_no.tmp = sitems.menu_no.tmp + 1
  575.                   tmp2 = sitems.menu_no.tmp
  576.                   sitem.menu_no.tmp.tmp2 = SItemName
  577.                   sitemHK.menu_no.tmp.tmp2 = HotKey
  578.                   sactions.menu_no.tmp.tmp2 = 0
  579.                   shelps.menu_no.tmp.tmp2 = 0
  580.                   next = action
  581.                 end
  582.               otherwise call PostError(99,"A") /* System Error - ABORT */
  583.             end
  584.           end
  585.         when trigger = action then
  586.           do
  587.             select
  588.               when LastCmd = Icmd then
  589.                 do
  590.                   tmp = items.menu_no
  591.                   actions.menu_no.tmp = actions.menu_no.tmp + 1
  592.                   tmp2 = actions.menu_no.tmp
  593.                   action.menu_no.tmp.tmp2 = substr(instr,2)
  594.                 end
  595.               when LastCmd = Scmd then
  596.                 do
  597.                   tmp = items.menu_no
  598.                   tmp2 = sitems.menu_no.tmp
  599.                   sactions.menu_no.tmp.tmp2 = sactions.menu_no.tmp.tmp2 + 1
  600.                   tmp3 = sactions.menu_no.tmp.tmp2
  601.                   saction.menu_no.tmp.tmp2.tmp3 = substr(instr,2)
  602.                 end
  603.               otherwise call PostError(99,"A") /* System Error - ABORT */
  604.             end
  605.           end
  606.         when trigger = help then
  607.           do
  608.             select
  609.               when LastCmd = Icmd then
  610.                 do
  611.                   tmp = items.menu_no
  612.                   helps.menu_no.tmp = helps.menu_no.tmp + 1
  613.                   tmp2 = helps.menu_no.tmp
  614.                   help.menu_no.tmp.tmp2 = substr(instr,2)
  615.                 end
  616.               when LastCmd = Scmd then
  617.                 do
  618.                   tmp = items.menu_no
  619.                   tmp2 = sitems.menu_no.tmp
  620.                   shelps.menu_no.tmp.tmp2 = shelps.menu_no.tmp.tmp2 + 1
  621.                   tmp3 = shelps.menu_no.tmp.tmp2
  622.                   shelp.menu_no.tmp.tmp2.tmp3 = substr(instr,2)
  623.                 end
  624.               otherwise call PostError(99,"A") /* System Error - ABORT */
  625.             end
  626.           end
  627.         otherwise call PostError(99,"A") /* System Error - ABORT */
  628.       end
  629.     end
  630.   else
  631.       /* One of the following fields is out of sequence - return an error */
  632.       do
  633.         if trigger = action then return 12 /* Action field out of sequence */
  634.         if trigger = name   then return 14 /* Name field out of sequence */
  635.         if trigger = cmd    then return 16 /* Command field out of sequence */
  636.         if trigger = help   then return 18 /* Help field out of sequence */
  637.       end
  638.   /* Line read in assumed to be a comment - ignore it */
  639. end
  640. call close('in')
  641. return 0
  642.  
  643. /*-----------------------------End of Rexx Source-----------------------------*/
  644.